package com.hejia.alauda.service;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import java.util.Map;

import com.hejia.alauda.entity.Agreement;
import com.hejia.alauda.entity.Financing;
import com.hejia.alauda.entity.Interest;
import com.hejia.alauda.entity.Product;
import com.hejia.alauda.entity.User;
import com.hejia.alauda.utils.Pager;

public interface FinancingService{
	
	Financing getFinancingById(Long id);
	
	Pager<Financing> findFinancingByProduct(Product product, Pager<Financing> pager);

	Pager<Financing> findFinancingByUser(User user, String type, Pager<Financing> pager);
	
	Pager<Financing> findInterestFinancingByProduct(Product product, Pager<Financing> pager);
	
	String renderingProtocolContent(String tid, String templateContent,
			User user, Financing financing, Long productId, String serial);
	
	String renderingProtocolContent(String tid, String templateContent,
			User user, Financing financing, Long productId);
		
	Boolean generateAgreement(Financing financing);
	
	List<Map<String, String>> findAgreementsByFinancing(Financing financing);
	
	Agreement  getAgreementBySerial(String serial);
	
	BigDecimal sumFinancingByTime(User user, String begin, String end);
	
	List<Interest> findInterestByUser(User user, String date);
	
	/**
	 * 根据用户ID查询累计总收益(包含红包和VIP加息)
	 * 
	 * @param user
	 * @return
	 */
	Map<String, Object> findTotalIncomeByUser(User user);
	
	/**
	 * 查询历史最高资产及收益
	 * 
	 * @param user
	 * @return
	 */
	Map<String, Object> findPastMaxAssetByUser(User user);
	
	
}
